<%@page import="fr.uparis10.m2miageclassic.entity.UFRs"%>
<%@page import="fr.uparis10.m2miageclassic.entity.TypeDiplome"%>
<%@page import="fr.uparis10.m2miageclassic.entity.Domaine"%>
<%@page import="fr.uparis10.m2miageclassic.entity.Diplome"%>
<%@ page import="javax.naming.*"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%!    private fr.uparis10.m2miageclassic.interfaces.MaquetteItf maquette = null;

    public void jspInit() {
        try {
            InitialContext ctx = new InitialContext();
            maquette = (fr.uparis10.m2miageclassic.interfaces.MaquetteItf) ctx.lookup("Maquette");
        } catch (Exception ex) {
            System.out.println("Couldn't create converter bean." + ex.getMessage());
        }
    }

    public void jspDestroy() {
        maquette = null;
    }
%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>mise à jour</title>
    </head>
    <body>
        <%  
            String numerodiplome = request.getParameter("iddip");
            String typeDiplome = request.getParameter("q3_typeDe");
            String ufr = request.getParameter("q4_ufr");
            String domaine = request.getParameter("q5_domaine");
            String mention = request.getParameter("q6_mention");
            String specialite = request.getParameter("q7_specialite");
            String diplome = request.getParameter("q8_diplome");
            if (numerodiplome != null && typeDiplome != null && ufr != null && domaine != null && mention != null && specialite != null && diplome != null) {
                maquette.editDiplome(numerodiplome, typeDiplome, ufr, domaine, mention, specialite, diplome);
            }
        %>
        <h1>Mise à jour réussit</h1>
    </body>
</html>
